package com.lanou.musicproject.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by dllo on 15/10/22.
 * 带歌曲下载试听url的实体类
 */
public class MusicInfo implements Parcelable{

    private int bitRate;
    private long duration; // 204590
    private long size; // 838623
    private String suffix; // m4a
    private String url; // 歌曲url
    private String typeDescription; // 压缩品质

    public MusicInfo() {
    }

    public MusicInfo(int bitRate, long duration, long size, String suffix, String url, String typeDescription) {
        this.bitRate = bitRate;
        this.duration = duration;
        this.size = size;
        this.suffix = suffix;
        this.url = url;
        this.typeDescription = typeDescription;
    }

    protected MusicInfo(Parcel in) {
        bitRate = in.readInt();
        duration = in.readLong();
        size = in.readLong();
        suffix = in.readString();
        url = in.readString();
        typeDescription = in.readString();
    }

    public static final Creator<MusicInfo> CREATOR = new Creator<MusicInfo>() {
        @Override
        public MusicInfo createFromParcel(Parcel in) {
            return new MusicInfo(in);
        }

        @Override
        public MusicInfo[] newArray(int size) {
            return new MusicInfo[size];
        }
    };

    public int getBitRate() {
        return bitRate;
    }

    public void setBitRate(int bitRate) {
        this.bitRate = bitRate;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public String getSuffix() {
        return suffix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getTypeDescription() {
        return typeDescription;
    }

    public void setTypeDescription(String typeDescription) {
        this.typeDescription = typeDescription;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(bitRate);
        dest.writeLong(duration);
        dest.writeLong(size);
        dest.writeString(suffix);
        dest.writeString(url);
        dest.writeString(typeDescription);
    }
}
